home *** CD-ROM | disk | FTP | other *** search
-
-
- /* test of html expand code insert */
- /* THIS CODE IS PROBABLY WRONG */
-
- if (XtIsSubclass(w, htmlWidgetClass)) {
- /*
- * now we can coerce the call_data into our widget type -
- * that is, if we can figure it out from the info above.
- * e.g. assume that we have a WbAnchorCallbackData callback
- */
- WbAnchorCallbackData *c_data = (WbAnchorCallbackData *) call_data;
-
- /*
- * examine each possible field of the callback struct in turn
- */
- if (length == strlen("element_id") &&
- strncmp(value, "element_id", length) == 0) {
-
- /*
- * this is an int value in this field, so convert to string
- */
- static char buf[16];
-
- sprintf(buf, "%d", c_data->element_id);
- return buf;
- } else
-
- if (length == strlen("text") &&
- strncmp(value, "text", length) == 0) {
-
- /*
- * this is a string, so just return it
- */
- return c_data->text;
- } else
-
- if (length == strlen("href") &&
- strncmp(value, "href", length) == 0) {
-
- return c_data->href;
- } else {
- /*
- * this occurs when the field asked for is not supported -
- * often caused by a typo in the user's program
- */
- return "ERROR in substitution";
- }
- }
-